package com.anxinr.pool;

import com.anxinr.info.Money;

public class InterfaceClass implements Runnable {
    @Override
    public void run() {
        synchronized (InterfaceClass.class){
            if (Money.money <= 0){
                System.out.println(Thread.currentThread().getName()+"订单已经抢空,没有拿到订单!");
            }else {
                try {
                    Thread.sleep(10);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                new Money().addMoney();
            }

        }
    }
}
